package com.wilmer.options.service.impl;

import java.util.List;
import com.wilmer.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wilmer.options.mapper.YwOptionsMapper;
import com.wilmer.options.domain.YwOptions;
import com.wilmer.options.service.IYwOptionsService;

/**
 * 题库题选项Service业务层处理
 *
 * @author zl
 * @date 2024-04-16
 */
@Service
public class YwOptionsServiceImpl implements IYwOptionsService
{
    @Autowired
    private YwOptionsMapper ywOptionsMapper;

    @Override
    public YwOptions selectYwOptionsByOptionId(Long optionId) {
        return this.ywOptionsMapper.selectYwOptionsByOptionId(optionId);
    }

    @Override
    public List<YwOptions> selectYwOptionsList(YwOptions ywOptions) {
        return this.ywOptionsMapper.selectYwOptionsList(ywOptions);
    }

    @Override
    public List<YwOptions> selectYwOptionsListByQuestionId(Long questionId) {
        return this.ywOptionsMapper.selectYwOptionsListByQuestionId(questionId);
    }

    @Override
    public int insertYwOptions(YwOptions ywOptions) {
        ywOptions.setCreateTime(DateUtils.getNowDate());
        return this.ywOptionsMapper.insertYwOptions(ywOptions);
    }

    @Override
    public int updateYwOptions(YwOptions ywOptions) {
        ywOptions.setUpdateTime(DateUtils.getNowDate());
        return this.ywOptionsMapper.updateYwOptions(ywOptions);
    }

    @Override
    public int deleteYwOptionsByOptionIds(Long[] optionIds) {
        return this.ywOptionsMapper.deleteYwOptionsByOptionIds(optionIds);
    }

    @Override
    public int deleteYwOptionsByOptionId(Long optionId) {
        return this.ywOptionsMapper.deleteYwOptionsByOptionId(optionId);
    }
}
